socket = require("socket")

t = {}
local _hora, _uptimem, _l1, _l2, _l3

while true do
	while true do
		local info = io.popen("uptime")
		local txt = info:read("*a")
		info:close()
		local _, _, hora, uptime, l1, l2, l3 = string.find(txt,"([0-9:]+) up (.+), load average: ([0-9%.]+),%s([0-9%.]+),%s([0-9%.]+)")
--		if _hora ~= hora
--		or _uptime ~= uptime
		if _uptime ~= uptime
		or _l1 ~= l1
		or _l2 ~= l2
		or _l3 ~= l3
		then
			_hora = hora
			_uptime = uptime
			_l1 = l1
			_l2 = l2
			_l3 = l3
			break
		end
		socket.sleep(1)
	end
	print(_hora, _uptime, _l1, _l2, _l3)
end